//
//  EnterButton.m
//  OCDemo
//
//  Created by zhumuzhi on 2021/7/27.
//

#import "EnterButton.h"

@interface EnterButton ()

@end

@implementation EnterButton

#pragma mark - Event
- (void)clickedEnterButton {
    if (self.enterBlock) {
        self.enterBlock();
    }
}

#pragma mark - SetData

- (void)setTitle:(NSString *)title {
    _title = title;
    [self setTitle:title forState:UIControlStateNormal];
}

#pragma mark - Init
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor grayColor];
        [self setTitle:@"入口" forState:UIControlStateNormal];
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.layer.cornerRadius = 5.0f;
        [self addTarget:self action:@selector(clickedEnterButton) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

@end
